﻿@using PagedList
@model PagedList.IPagedList<ShenLanCMS.Models.Post>
@{
    var type = ViewData["type"] as ShenLanCMS.Models.PostType;
    ViewBag.Title = type.TypeName + " 分类列表";

    Layout = "~/Views/Shared/_PublicLayout.cshtml";
}
<fieldset>
    <legend></legend>
    <div id="nav">
        <a href="/">首页</a> >> <a href="/post/alltype">所有分类</a> >> @ViewBag.Title
    </div>
    <br />
    <br />
    <div>
        @foreach (var item in Model)
        {
         <li><a href="/post/view/@item.PostID" title="@item.Title" target="_blank">@item.Title</a> [@item.PubTime] (点击:@item.Click)</li>
        }
    </div>
    <br />
    <div style="width: auto; height: 30px; margin-top: 10px; text-align: left;">
        @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber)
        / @Model.PageCount
        &nbsp;
        @if (Model.HasPreviousPage)
        {
            @Html.ActionLink("首页", ViewData["actionName"].ToString(), new { page = 1, keyword = ViewData["keyword"] })
            @Html.Raw("&nbsp;");
            @Html.ActionLink("< 上一页", ViewData["actionName"].ToString(), new { page = Model.PageNumber - 1, keyword = ViewData["keyword"] })
        }
        else
        {
            @Html.Raw("首页&nbsp;&nbsp;上一页")
        }
        &nbsp;
        @if (Model.HasNextPage)
        {
            @Html.ActionLink("下一页 >", ViewData["actionName"].ToString(), new { page = Model.PageNumber + 1, keyword = ViewData["keyword"] })
            @Html.Raw("&nbsp;");
            @Html.ActionLink("尾页", ViewData["actionName"].ToString(), new { page = Model.PageCount, keyword = ViewData["keyword"] })
        }
        else
        {
            @Html.Raw("下一页&nbsp;&nbsp;尾页")
        }
    </div>
</fieldset>
